package commands

import (
	"project/design/command/recievers"
)

type LightOnCommand struct {
	*recievers.Light //不写变量名就是集成，可以直接使用里面的方法
}

func CreateLightOnCommand(light *recievers.Light) *LightOnCommand {
	return &LightOnCommand{light}
}

func (loc *LightOnCommand) Execute() {
	loc.On()
}

func (loc *LightOnCommand) Undo() {
	loc.Off()
}
